package phone.qyg.com.qyg.model.baidu;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * 作者：lblbh on 2017/6/6 16:40
 * 邮箱：lanbuhan@163.com
 * 功能：百度地图 使用传递数据
 */
public class TranInfo  implements Parcelable {

    public double latitude;
    public double longitude;
    public double cureentLatitude;
    public double cureentLongitude;

    public int type;//0--到这里去 1-从这里出发
    public String address;
    public String currentAddress;//当前位置


    public TranInfo() {}

    public TranInfo(double latitude, double longitude,double cureentLatitude,
                    double cureentLongitude, String address,String currentAddress, int type) {
        this.latitude = latitude;
        this.longitude = longitude;
        this.cureentLatitude = cureentLatitude;
        this.cureentLongitude = cureentLongitude;
        this.address = address;
        this.type = type;
        this.currentAddress = currentAddress;
    }

    @SuppressWarnings("unchecked")
    public TranInfo(Parcel in) {
        type = in.readInt();
        latitude = in.readDouble();
        longitude = in.readDouble();
        cureentLatitude = in.readDouble();
        cureentLongitude = in.readDouble();
        address = in.readString();
        currentAddress = in.readString();
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(type);
        dest.writeDouble(latitude);
        dest.writeDouble(longitude);
        dest.writeDouble(cureentLatitude);
        dest.writeDouble(cureentLongitude);
        dest.writeString(address);
        dest.writeString(currentAddress);

    }

    public static final Creator<TranInfo> CREATOR = new Creator<TranInfo>() {
        @Override
        public TranInfo[] newArray(int size) {
            return new TranInfo[size];
        }

        @Override
        public TranInfo createFromParcel(Parcel in) {
            return new TranInfo(in);
        }
    };
}
